WA-RAILS7-008: Update ActiveSupport::Deprecation for Rails 7.1+#707
WA-RAILS7-008: Update ActiveSupport::Deprecation for Rails 7.1+#707kitcommerce merged 1 commit intonextfrom
Conversation
Architecture Review{
"reviewer": "architecture",
"verdict": "PASS",
"severity": null,
"summary": "Clean, minimal change that correctly uses respond_to? feature detection for Rails version compatibility.",
"findings": []
}Verdict: PASS ✅ The design is sound:
No architectural concerns. |
Simplicity ReviewVerdict: PASS {
"reviewer": "simplicity",
"verdict": "PASS",
"severity": null,
"summary": "Change is minimal, clear, and uses idiomatic Rails compatibility guard — no simplicity concerns.",
"findings": []
}The |
🔒 Security Review{
"reviewer": "security",
"verdict": "PASS",
"severity": null,
"summary": "No security implications — change registers an internal deprecator with no user input, no serialization, and no auth or data exposure changes.",
"findings": []
}The |
Rails Conventions ReviewVerdict: PASS_WITH_NOTES {
"reviewer": "rails-conventions",
"verdict": "PASS_WITH_NOTES",
"severity": "LOW",
"summary": "The approach is idiomatic and safe; one low-priority note about duck-typing vs. version-checking conventions for Rails engines.",
"findings": [
{
"severity": "LOW",
"file": "core/lib/workarea.rb",
"line": 183,
"issue": "Using respond_to?(:deprecators) for version detection is duck-typing, which is generally acceptable, but Rails engine gems more commonly guard on Rails::VERSION::MINOR >= 1 (for 7.1+) to express intent clearly. The current approach will silently succeed if any other object happens to define :deprecators on Rails.application in the future.",
"suggestion": "Consider replacing the respond_to? guard with an explicit version check: if Rails.gem_version >= Gem::Version.new('7.1'). This makes the intent explicit and is the Rails engine community convention for API availability guards." }
]
}NotesThe core change is sound and idiomatic:
On the version-detection approach: |
Rails Conventions ReviewVerdict: PASS_WITH_NOTES {
"reviewer": "rails-conventions",
"verdict": "PASS_WITH_NOTES",
"severity": null,
"summary": "Follows Rails conventions correctly; respond_to? is idiomatic for feature detection and deprecators registration matches Rails 7.1+ documented patterns.",
"findings": [
{
"severity": "LOW",
"file": "core/lib/workarea.rb",
"line": 183,
"issue": "Rails.application.deprecators[:workarea] ||= deprecator uses ||= inside a block that is itself guarded by @deprecation ||=, making the inner guard redundant.",
"suggestion": "Use direct assignment: Rails.application.deprecators[:workarea] = deprecator. The outer memoization already ensures this block runs at most once per process."
}
]
}Notesrespond_to? pattern ✅ — Duck typing for feature detection is idiomatic Ruby/Rails and more robust than version string comparison. Correct choice here. deprecators registration ✅ — Lazy registration Inner ||= redundancy (LOW, non-blocking) — See finding above. Cosmetic, no correctness impact. |
Rails Security ReviewVerdict: ✅ PASS No security concerns. The change registers an internal deprecation instance with |
Database ReviewVerdict: PASS No database changes in this PR. The deprecation system update and gem version bumps have no data layer impact. |
Rails Security ReviewVerdict: PASS No Rails security concerns. Internal deprecation tooling change — no user input, no auth flows, no data access changes. Dragonfly and loofah updates fix CVEs. |
Register deprecator with Rails.application.deprecators when available (Rails 7.1+) while maintaining backward compatibility with Rails 6.x. Closes #700
56e362a to
a8681b7
Compare
Architecture ReviewVerdict: ✅ PASS_WITH_NOTES SummaryClean, minimal change that correctly adapts FindingsNo issues found. The change is architecturally sound:
Notes (observational, no action needed)
RecommendationMerge as-is. The approach is consistent with how other gems (e.g., |
Security ReviewVerdict: ✅ PASS Reviewer: Security SummaryThis change updates FindingsNo security issues found. Specifically verified:
RecommendationsNone. This is a minimal, well-scoped internal tooling change with no security surface. |
Simplicity ReviewVerdict: PASS_WITH_NOTES (LOW) Findings
Recommendations
SummaryChange is well-scoped and proportionate. No over-engineering, no new concepts, no unnecessary abstraction. Public API is unchanged. The two LOW notes are cosmetic cleanup suggestions, not correctness concerns. |
Rails Conventions ReviewVerdict: PASS FindingsNo Rails convention violations. This is a clean, idiomatic change. What the diff does (conventions lens):
Works with Rails, not against it. The change embraces the framework's evolving deprecation conventions rather than fighting them or papering over the difference. RecommendationsNone required. One observational note:
Reviewed by: rails-conventions agent | Wave 1 |
Rails Security ReviewVerdict: PASS FindingsNo Rails security concerns. This change modifies internal deprecation infrastructure only — no user-facing input, no parameter handling, no query construction, no view rendering, no authentication/authorization changes, and no secrets. RecommendationsNone. |
Database ReviewVerdict: PASS Findings
Recommendations
|
Test Quality ReviewVerdict: PASS_WITH_NOTES Findings
Recommendations
ContextThe change itself is simple, idiomatic, and the CI matrix provides meaningful confidence (both Rails versions run the full test suite). The gap is that the CI passes via indirect coverage — if a future change breaks the |
Performance ReviewVerdict: PASS Findings
Recommendations
|
Frontend ReviewVerdict: PASS Findings
Recommendations
|
Accessibility ReviewVerdict: PASS Findings
Recommendations
|
Documentation ReviewVerdict: PASS_WITH_NOTES Findings
|
✅ All Review Waves PassedAll reviewers returned PASS or PASS_WITH_NOTES. This PR is merge-ready.
Labeled |
Summary
Updates
Workarea.deprecationto register withRails.application.deprecatorswhen running on Rails 7.1+, while keeping backward compatibility with Rails 6.x.Changes
core/lib/workarea.rb: Updatedself.deprecationto detectRails.application.deprecatorsviarespond_to?and register the deprecator when availableApproach
Uses a
respond_to?guard so:ActiveSupport::Deprecation.new('3.6', 'Workarea')as beforeRails.application.deprecators[:workarea]The public
Workarea.deprecationAPI is unchanged — callers don't need to be updated.Client impact
None — internal deprecation tooling only. No public API changes.
Related
Closes #700